package springboot.webservicers.service.impl;


import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ResponseBody;
import springboot.webservicers.model.Student;
import springboot.webservicers.service.IStudentService;
import springboot.webservicews.model.User;

import java.util.ArrayList;
import java.util.List;

@Component
public class StudentServiceImpl implements IStudentService {

    @Override
    public Student getById( int id) {
        Student student=new Student();
        student.setId(id);
        student.setName("胖胖");
        student.setAge(23);
        User user1=new User();
        user1.setId((long) 12);
        user1.setName("松松");
        user1.setAge(24);
        User user2=new User();
        user2.setId((long) 15);
        user2.setName("胖胖");
        user2.setAge(23);
        List<User> list=new ArrayList<>();
        list.add(user1);
        list.add(user2);
        student.setList(list);
        System.out.println("你传过来的id是"+id);
        return student;
    }
}
